package com.mapper;

import com.pojo.DataTeacherStation;
import com.pojo.SClass;
import com.pojo.Sdept;
import com.pojo.TopicType;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface DataMapper {

    @Select("select * from topic_type")
    List<TopicType> getTopicTypeList();

    @Select("select count(*) from topic where type_id = #{type_id}")
    Integer getTopicTotalByType(Integer type_id);

    @Select("select s.name,count(*) as value from teacher join station s on s.id = teacher.station_id group by station_id")
    List<DataTeacherStation> getTeacherStationList();

    @Select("select * from sdept")
    List<Sdept> getSdeptList();

    @Select("select * from s_class where sdept_id = #{sdept_id}")
    List<SClass> getClassTotalBySdept(Integer sdept_id);

    @Select("select count(*) from student where class_id = #{class_id}")
    Integer getStudentTotalByClass(Integer class_id);

}
